package books.to.africa

class BookRequest{

String title
String description
String category
Date minDate
Date maxDate
String minGradeLevel
String maxGradeLevel
Date dateRequested = new Date()
//def Donors //will be a list of Donor objects who pledged to send books
//category and quantity?

//non required specificity fields

static belongsTo = [ FillList, TeacherRegister ]


static constraints = {
	title(blank:false)
	description(nullable: true, maxSize: 1000)
	category(blank: false, inList: ["General Leisure Reading", "Reading Skills", "Math Skills", "Health", "Science"])
	minDate()
	maxDate()
	minGradeLevel(blank: false, inList: ["0", "1", "2", "3", "4", "5", "6"])
	maxGradeLevel(blank: false, inList: ["0", "1", "2", "3", "4", "5", "6"], validator:
		{entry, inst -> return entry >= inst.minGradeLevel})

}



}


